package com.jinsp.webview;

import android.content.Intent;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.jinsp.webviewservice.WebViewActivity;
import com.jinsp.webviewservice.webview.WebViewConfig;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void onClick(View view) {
        WebViewConfig webViewConfig = new WebViewConfig.Builder()
                .setUrl("https://www.baidu.com")
                .setBackDrawableId(R.mipmap.ic_launcher)
                .setTitleBackground(Color.RED)
                .setRefreshColor(Color.BLUE)
                .build();
        Intent intent = new Intent(this, WebViewActivity.class);
        intent.putExtra(WebViewConfig.TAG, webViewConfig);
        startActivity(intent);
    }
}